package com.github.chirspan.xaas.uc.web.api;


import com.github.chirspan.xaas.api.BaseCRUDRestController;
import com.github.chirspan.xaas.core.rest.RestResult;
import com.github.chirspan.xaas.uc.model.OrgDepartment;
import com.github.chirspan.xaas.uc.service.IOrgDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @Author: chenpan
 * @Date: 2021-08-10 11:03:10
 * @Description: 科室信息 REST API
 */
@RestController
@RequestMapping("department")
public class OrgDepartmentController extends BaseCRUDRestController<OrgDepartment> {

    @Autowired
    private IOrgDepartmentService departmentService;

    @GetMapping("/_tree")
    public RestResult getDepTree(OrgDepartment department ) {
        List<OrgDepartment> list = departmentService.getDepTree(department);
        return RestResult.OK(list, "请求成功");
    }
}
